<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page isELIgnored="false"%>
<%@ include file="../common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<title>操作员查询</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="stylesheet" href="<s:url value="/css/common.css"/>"/>
<script type="text/javascript" src="<c:url value="/js/common.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/My97DatePicker/WdatePicker.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery-1.9.1.js" />"></script>
<script type="text/javascript" src="<c:url value="/js/tabcontrol/TabPanel.js" />"></script>
<script type="text/javascript">

	$(document).ready(
			function() {
			
			$("#btnDelay").click(
			function(){
				var len = $(":checkbox[name=multi_sel]:checked").length;
				if(len == 0){
					alert("请先选择要延迟有效时间的记录!!!");
					return false;
				}else{
					$("#queryForm").attr("action","${rootPath}/query/delay.ct");
					return true;  
			    }
			});
			
			$("#resetPwd").click(
			function(){
				var dd = $(":checkbox[name=multi_sel]:checked");
				if(dd.length > 0){
					$("#queryForm").attr("action","${rootPath}/query/resetPwd.ct");
					return true;
				}else{
					alert('请选择需要重置的用户！');
					return false;
				}
			});
	});
	
	function addpanel(id,title,html){
	      window.parent.parent.document.getElementById("framemain").contentWindow.addtabs(id,title,html);
	}

	
</script>



</head>

<body>
<s:form id="queryForm" action="/query/queryOperators.ct" method="post" theme="simple">
<table class="tb">
    <tbody>
        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h2">POS收单运营管理平台</div></td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td" colspan="4"><div class="tb-h3">操作员查询</div></td>
        </tr>
		<s:if test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\" || #session.session_merchant.roleType==\"16\"">
			  <td align="right" width="15%"></td>
			  <td>
                  <s:hidden name="searchCondition.orgCode" value="%{#session.session_merchant.orgCode}" />
			  </td>
		</s:if><s:else>
              <tr class="tb-line">
           <td width="12%" style="min-width: 150px" align="right" class="tb-td">
               <div class="tb-h4">所属机构：</div>
           </td>
           <td class="tb-td">
           
               <label class="tb-select">
                 <s:select name="searchCondition.orgCode"
						id="orgCode" list="#request.orgList" listKey="insIdCd" listValue="insName"/>
               </label>
           </td>
           <td width="12%" style="min-width: 150px" align="right" class="tb-td">
               <div class="tb-h4">角色：</div>
           </td>
           <td class="tb-td">
               <label class="tb-select">
                 <s:select name="searchCondition.roleType" 
			     id="roleType" list="#request.roleList" listKey="key" listValue="value" 
			     headerKey="99" headerValue="--请选择--"/>
               </label>
           </td>
       </tr>
	</s:else>
   

        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">操作员账号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="accountNo"
							name="searchCondition.accountNo" /></label>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">操作员姓名：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="realName"
							name="searchCondition.realName" /></label>
            </td>
        </tr>

        <tr class="tb-line">
            <td align="right" class="tb-td">
                <div class="tb-h4">手机号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="mobile"
							name="searchCondition.mobile" /></label>
            </td>
            <td align="right" class="tb-td">
                <div class="tb-h4">证件号：</div>
            </td>
            <td class="tb-td">
                <label class="tb-input-normal"><s:textfield id="cardNo"
							name="searchCondition.cardNo"/></label>
            </td>
        </tr>

        <tr class="tb-line">
            <td class="tb-td line-submit" align="right" colspan="4">
                <label class="tb-input-submit">
                    <s:submit  value="查 询" />
                </label>
                <label class="tb-input-submit">
                   <s:reset value="取 消" />
                </label><br/>
                <label class="tb-input-submit">
                    <s:if test="#request.searchRsList != null && #request.searchRsList.size>0">
						<s:submit id="btnDelay" value="延长有效期" />
					</s:if> <s:else>
						<s:submit disabled="true" id="btnDelay" value="延长有效期" />
					</s:else> 
                </label>
                <label class="tb-input-submit">
                  <s:if test="#request.searchRsList != null && #request.searchRsList.size>0&&(#session.session_merchant.roleType=='00'||#session.session_merchant.roleType=='01'||#session.session_merchant.roleType=='02'||#session.session_merchant.roleType=='03'||#session.session_merchant.roleType=='10'||#session.session_merchant.roleType=='11')">
					<s:submit id="resetPwd" value="重置密码" />
				</s:if>
				<s:else>
					<s:submit disabled="true" id="resetPwd" value="重置密码" />
				</s:else>
                </label>
            </td>
        </tr>
    </tbody>
</table>
	
			

<div class="big-tb">
    <table class="tb" style="width: 100%;">
        <thead>
        	<tr class="tb-line">
				<td colspan="12" align="center"><span style="font-color: red"><s:actionerror /></span>
					<span style="font-color: red;"><s:actionmessage /></span > <span style="font-color: red;"><s:fielderror /></span>
					<span id="otherError"></span>
				</td>
			</tr>
            <tr class="tb-line">
                <th class="tb-th"  colspan="12">操作员基本信息列表</th>
            </tr>
            <s:if test="#request.searchRsList != null && #request.searchRsList.size>0" >
					<tr class="tb-line">
						<td class="tb-td paging"  colspan="12"> 
							<page:pageCount max_pages="11" totalPage="${requestScope.totalPage}" currentPage="${requestScope.currentPage}" action="${rootPath}/query/queryOperators.ct?currentPage=" />
						</td>
					</tr>
				</s:if>
            <tr class="tb-line bg-gray">
                <th class="tb-th">选择</th>
                <th class="tb-th">账号</th>
                <th class="tb-th">姓名</th>
                <th class="tb-th">性别</th>
                <th class="tb-th">手机号</th>
               	<s:if test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\"||#session.session_merchant.roleType==\"16\"">
					</s:if><s:else>
					<th class="tb-th" >所属机构</th>
				</s:else>
                <th class="tb-th">角色类型</th>
                <th class="tb-th">证件号</th>
                <th class="tb-th">状态</th>
                <th class="tb-th">有效开始时间</th>
                <th class="tb-th">有效结束时间</th>
                <th class="tb-th">操作</th>
            </tr>
        </thead>
        <tbody>
		<s:iterator value="#request.searchRsList" status="stat" id="oper">
						<tr class="tb-line">
							<td class="tb-td">
								<s:if test="#session.session_merchant.id==#oper.id||#oper.status=='02'">
									<s:checkboxlist disabled="true" name="multi_sel" list="#{#oper.id:''}" theme="simple" />
						  		</s:if> 
								<s:else>
									<s:checkboxlist name="multi_sel" list="#{#oper.id:''}" theme="simple" />
								</s:else>
							</td>
							<td class="tb-td">
								[<s:if test="#oper.roleType=='02'||#oper.roleType=='03'">
									<s:a href="agentDetailed.ct?accountNo=%{#oper.accountNo}">
										<s:property value="#oper.accountNo" />
									</s:a>
								</s:if> <s:else>
									<s:a href="otherDetailed.ct?accountNo=%{#oper.accountNo}">
										<s:property value="#oper.accountNo" />
									</s:a>
								</s:else>]
							</td>

							<td class="tb-td">
								<s:if test="#session.session_merchant.id!=#oper.id&& #oper.roleType!='03'&& #oper.roleType!='02'">
									<s:a href="javascript:addpanel('','操作员基本信息修改','/fmposm/query/modif.ct?id=%{#oper.id}')">
										<s:property value="#oper.realName" />
									</s:a>
						  		</s:if> 
								<s:else>
									<s:property value="#oper.realName" />
								</s:else>
							</td>
							<td class="tb-td" >
								<s:if test="#oper.sex==1">男</s:if> <s:elseif
									test="#oper.sex==0">女</s:elseif> <s:else></s:else>
							</td>
							<td class="tb-td" >
								<s:property value="#oper.mobile" />
							</td>
							<s:if
								test="#session.session_merchant.roleType==\"03\"||#session.session_merchant.roleType==\"15\"||#session.session_merchant.roleType==\"16\"">
							</s:if>
							<s:else>
								<td class="tb-td" ><s:property value="#oper.orgName" /></td>
							</s:else>
							<td class="tb-td" ><s:property value="#oper.roleName" /></td>
							<td class="tb-td" ><s:property value="#oper.cardNo" /></td>
							<td class="tb-td" ><s:if test="#oper.status=='00'">正常</s:if> <s:elseif
									test="#oper.status=='02'">注销</s:elseif></td>
							<td class="tb-td"><s:property value="#oper.validStartDate" /></td>
							<td class="tb-td" ><s:property value="#oper.validEndDate" /></td>
							<td class="tb-td" ><s:if test="#session.session_merchant.id!=#oper.id">
									<s:if test="#oper.status=='00'">
										<s:a href="logOut.ct?oper.id=%{#oper.id}">注销</s:a>
									</s:if>
									<s:elseif test="#oper.status=='02'">
										<s:a href="recover.ct?oper.id=%{#oper.id}">恢复</s:a>
									</s:elseif>
									<s:else>无操作</s:else>
								</s:if>
								<s:else>无操作</s:else></td>
						</tr>
					</s:iterator>
        </tbody>
    </table>
</div>
</s:form>
	<s:if test="#request.info_request !=null">
	<script language="javascript">
	    alert("${request.info_request}");
	    </script>
	</s:if>	
</body>
</html>
